const { h, mount, Component, Text } = require('ink')

class Counter extends Component {
	constructor() {
		super()
		this.state = {
			i: 0
		}
	}
	componentDidMount() {
		this.timer = setInterval(() => {
			this.setState({
				i: this.state.i + 1
			})
		}, 100)
	}
	componentWillUnmount() {
		clearInterval(this.timer)
	}
	render() {
		return (
			<Text red>
				{this.state.i} tests passed
			</Text>
		)
	}
}

console.log()

mount(<Counter />, process.stdout)